home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / amistuff.zip / FONT.INF < prev    next >
Text File  |  1991-01-20  |  11KB  |  187 lines

  1.          How Ami And Ami Pro Select Fonts
  2.          
  3.          Because there are so many parameters in the Windows font selection 
  4.          system, you have to understand Ami's and Ami Pro's font selection 
  5.          algorithm to predict exactly how it will behave in a given 
  6.          situation.  So here's how  the three steps of font selection go:
  7.          
  8.          The User Chooses A Font
  9.          
  10.          Ami and Ami Pro present the user with a list of face names the 
  11.          printer driver claims to support.  The only faces omitted from the 
  12.          list are those in Windows character set 37, which are the Ami and 
  13.          Ami Pro symbol fonts (there are four).  Some printer drivers, like 
  14.          most dot matrix drivers, support the Windows screen fonts as well 
  15.          as fonts the printer has built-in; others, like the LaserJet and 
  16.          Postscript drivers, support only printer-specific fonts.
  17.          
  18.          Ami 1.0 allowed the user to choose only from the ANSI fonts, 
  19.          intending to standardize on their use.  However, many users wanted 
  20.          access to the Windows vector fonts Roman, Script and Modern, which 
  21.          are in the OEM character set.  Ami Pro 1.1A added access to the 
  22.          OEM character set.  But then the LaserJet driver added some 
  23.          support for a third character set.  To put these problems to rest, 
  24.          1.1B took the all-inclusive approach.
  25.          
  26.          Once the face name is picked, Ami and Ami Pro try to establish 
  27.          what point sizes are available.  Some printers can scale their 
  28.          fonts to any size, i.e. Postscript.  When the printer driver 
  29.          indicates that it can scale fonts, Ami and Ami Pro put a standard 
  30.          list of point sizes in the list box (6, 8, 10, 12, 18, 24, 36, 48) 
  31.          and also enable the edit box so the user can type any point size 
  32.          he needs.
  33.          
  34.          Other printers can scale some of their fonts but not others. The 
  35.          only known case of this so far is the Canon LBP8 III.  Ami 
  36.          Professional can deal with this too.  In general, if the printer 
  37.          cannot scale fonts, but an individual font reports that it is a 
  38.          "scale-able" vector font, Professional allows any point size to be 
  39.          entered.
  40.          
  41.          The third class of printers is the one which cannot scale its 
  42.          fonts, like the LaserJet and dot matrix printers.  Here the 
  43.          printer driver reports exactly what fonts are available and in 
  44.          what point sizes. Ami and Ami Pro offer only those sizes as 
  45.          alternatives.
  46.          
  47.          In the Modify Style dialog box, Ami and Ami Pro go one step 
  48.          further and actually only allow bold or italic or underline to be 
  49.          chosen if the printer can supply that enhancement.  For example, 
  50.          one LaserJet cartridge has Helv 14-point in bold only. When you 
  51.          choose Helv 14 in the Modify Style box, Ami and Ami Pro 
  52.          automatically check the bold box and grey out the normal box. In 
  53.          the Text menus, however, Ami and Ami Pro don't make this extra 
  54.          check.
  55.          
  56.          Dot matrix printers generally support the Windows GDI (Graphics 
  57.          Display Interface) fonts.  These are the Tms Rmn, Helv, and 
  58.          Courier fonts that are intended for the screen, along with any 
  59.          other screen fonts the user may have added to his WIN.INI file. 
  60.          The theory with GDI fonts is that GDI can scale them up (larger) 
  61.          by integral factors from 2X to 8X, and wider by integral factors 
  62.          from 2X to 5X if necessary.  So any one screen font is available 
  63.          on the printer in eight heights.  In the case of Tms Rmn, where 
  64.          Windows supplies 6 sizes, and Ami and Ami Pro supply another 6, 
  65.          that leaves (6 + 6) X 8 = 96 size choices.
  66.          
  67.          What complicates these choices is that, first of all, some of 
  68.          those sizes are the same -- that is, 8-point tripled is the same 
  69.          as 12-point doubled.  The second and more troublesome complication 
  70.          is that when GDI scales a font up, the total size of the result 
  71.          cannot be more than 64K.  Because Ami and Ami Pro can not know the 
  72.          size (in bits) of a font, they can not know when to eliminate 
  73.          these choices.  The effect is that a user may pick a 96-point font 
  74.          but get something only 48 points high.  Ami Pro limits the extent 
  75.          of the problem by never listing any font choice over 100 points.
  76.          
  77.          Ami And Ami Pro Ask The Printer For That Font
  78.          
  79.          Once the user has asked for a font, it is presumably available on 
  80.          the printer.  Of course if he changes the printer, the fonts sizes 
  81.          and faces requested may no longer be available.
  82.          
  83.          Regardless of how the font is specified, through a style sheet or 
  84.          through the Text menu or from the drawing module, Ami and Ami Pro 
  85.          attempt to print or display it by asking Windows for the closest 
  86.          font available on the printer.  If printing, Ami and Ami Pro 
  87.          simply output the text and the printer uses that font.  The 
  88.          spacing between words and between letters in a word is left just 
  89.          as the printer normally does it, except in two cases:  when a 
  90.          paragraph is marked justified, Ami and Ami Pro tell the printer 
  91.          driver to add extra space between the words to make both margins 
  92.          flush; and when a paragraph style specifies loose or tight line 
  93.          tightness, the software asks the printer driver to tighten or 
  94.          loosen the inter-character spacing.  The actual amount of 
  95.          tightening or loosening is the same on each character, and is 
  96.          equal to the percentage given in the dialog box (90% or 115%) 
  97.          times the average character width of the font.
  98.          
  99.          If Ami and Ami Pro are displaying a document on the screen (in 
  100.          layout mode), they don't directly use that font, but instead make 
  101.          calls to the printer driver to find out how tall the font is and 
  102.          how wide the characters are.  This information is then used to 
  103.          wrap the text, and it is also used to select a corresponding 
  104.          screen font.
  105.          
  106.          Then Ami and Ami Pro Get A Suitable Screen Font
  107.          
  108.          The trickiest part of the font selection in Ami and Ami Pro is in 
  109.          selecting a screen font, given the printer font's characteristics. 
  110.           Remember, to display a font, first Ami and Ami Pro ask the 
  111.          printer driver for its closest match to the requested font; and 
  112.          then the characteristics of the printer font are fed back to the 
  113.          screen driver to find the closest match. The selection happens in 
  114.          several steps; how many steps it takes depends on how close a 
  115.          match is available for the printer font. Here are the steps:
  116.          
  117.          1.
  118.          First Ami and Ami Pro take the characteristics of the printer 
  119.          font, including its name, point size, average width, character 
  120.          set, and attributes (bold, italic, underline, etc.), and ask the 
  121.          Windows font mapper to get as close to that as possible for the 
  122.          screen font.  For Ami and Ami Pro to be happy with that choice, 
  123.          the font has to be no more than 7% taller (Ami Pro) than the font 
  124.          on the printer (10% in Ami 1.0).  Windows may have returned a 
  125.          taller font if it thought that other considerations made it the 
  126.          right choice.
  127.          
  128.          2.
  129.          If Ami (or Ami Pro) is not happy with the first font, it makes a 
  130.          broader request to Windows, with the same characteristics as 
  131.          before, except it will settle for any type face in the same class 
  132.          (serif or no, proportional or no).  In either case, what Windows 
  133.          comes up with must pass the test that the average character width 
  134.          be no more than 7% wider than the printer font we're trying to 
  135.          match (10% in Ami 1.0).  The reason for this test is that when a 
  136.          screen font is too wide, Ami and Ami Pro display WYSIWYG line 
  137.          endings and lose all the space between the words.  This doesn't 
  138.          always solve the problem, however.
  139.          
  140.          3.
  141.          If the above two steps don't produce a screen font Ami and Ami Pro 
  142.          can use, the software starts reducing the point size it asks for 
  143.          by 1 and asks again.  The fonts that this process returns have to 
  144.          pass the 7% (Ami Pro) and 10% (Ami 1.0) width test. Eventually, 
  145.          the software finds a smaller screen font it's happy with, or if 
  146.          not, it decides to greek the font.  Greeking is done using the 
  147.          height and width of the text as the printer driver reports it.
  148.          
  149.          At any point along this path, Windows can give back a totally 
  150.          incorrect screen font by deciding, for example, that it has an 
  151.          italic font that's just perfect, even if we didn't ask for an 
  152.          italic font.  This is why, in rare cases, you see italics even if 
  153.          you didn't ask for it, and don't get it on the printer.
  154.          
  155.          All of this screen font selection goes through the view scaling 
  156.          logic, since naturally to show a 12-point font in enlarged view 
  157.          takes a different screen font than to show it in working view. 
  158.          When screen font manufacturers provide a certain point size, that 
  159.          point size is for our standard view.  How well that screen font 
  160.          fares in other views is not, in general, tested by those third 
  161.          parties.  Working view causes the most troubles.  We chose 91% as 
  162.          the default because that usually requires exactly one point size 
  163.          smaller on the screen.
  164.          
  165.          To display a line on the screen, Ami (and Ami Pro) takes the 
  166.          screen font it has laboriously extracted, and finds out how long 
  167.          the line would be using that font.  To display the font, Ami (and 
  168.          Ami Pro) instructs Windows to compensate for the difference 
  169.          between natural printer length and the natural screen width by 
  170.          squeezing or stretching the space between words.  This leaves the 
  171.          intercharacter spacing constant for better legibility. Windows 
  172.          will not, however, squeeze the words over top of each other, and 
  173.          Ami and Ami Pro don't get told when the amount of squeezing it has 
  174.          requested would result in that.  So when the screen font selection 
  175.          has not been entirely successful, and all the spaces between words 
  176.          disappear, the software cannot place the cursor in the right 
  177.          place, and editing becomes very difficult.  In these cases, it is 
  178.          advantageous to use draft mode for editing.
  179.          
  180.          When using a fixed pitch font, Ami and Ami Pro will occasionally 
  181.          tighten the intercharacter spacing of the screen font so that 
  182.          columns line up a little better.  This is only a secondary effect, 
  183.          though, and should only be obvious in unusual cases.
  184.          
  185.          December 11, 1989
  186.          
  187.